package com.sscl.easyble

import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Looper
import java.util.concurrent.ScheduledThreadPoolExecutor
import java.util.concurrent.ThreadFactory

/**
 * 全局常量
 */
@SuppressLint("StaticFieldLeak")
internal object InternalConstants {

    internal lateinit var context: Context

    internal val handler = Handler(Looper.getMainLooper())

    internal val threadFactory = ThreadFactory { r -> Thread(r) }

    /**
     * 创建一个线程定时任务
     */
    internal fun newScheduledThreadPoolExecutor(): ScheduledThreadPoolExecutor {
        return ScheduledThreadPoolExecutor(1, threadFactory)
    }

    internal const val CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb"
}